import Vue from 'vue'
import Vuex from 'vuex'
import state from './state'
import mutations from './mutations'

Vue.use(Vuex)



export default new Vuex.Store ({
    // ES6中键和值一样，可以直接省略state: state,mutations: mutations
    state,
    // 不用通过action的dispatch，而是直接commit到mutations
   /*  actions: {
        changeCity(context,city) {
            context.commit('changeCity',city)
        }
    },  */
    mutations,
    /* getters: {
        doubleCity (state) {
            return state.city + ' ' + state.city
        }
    } */
})